package cn.usian.config;

import cn.usian.common.LoginInterceptor;
import org.springframework.stereotype.Component;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
@Component
public class MyConfig implements WebMvcConfigurer {

    /**
     * 拦截器对应配置类加载到拦截器的责任
     * @param registry
     */
    public void  addInterceptors(InterceptorRegistry registry){
        registry.addInterceptor(new LoginInterceptor()).addPathPatterns("/student/**");
    }
}
